package com.thread.signal.second;

/**
 * @description:
 * @author: 刘建楼
 * @create: 2021-04-20
 **/
public class DrawThread3 extends Thread {

    private Account3 account3;
    // 当前取钱线程所希望取的钱数
    private double drawAmount;

    public DrawThread3(String name, Account3 account3, double drawAmount) {
        super(name);
        this.account3 = account3;
        this.drawAmount = drawAmount;
    }

    // 执行100次取钱操作
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            account3.draw(drawAmount);
        }
    }

}
